package com.zcx.common;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.zcx.R;
import com.zcx.base.BaseDialog;

/**
 * @author：zcx
 * @date:on 2018/3/7 0007 10:14
 */

public class ProgressDialog extends BaseDialog {
    private String loadStr = "";

    private ProgressBar pbLoad;
    private TextView tvLoad;

    public ProgressDialog(@NonNull Activity context) {
        super(context, R.style.Progress_Dialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_progress);

        pbLoad = findViewById(R.id.pb_load);
        tvLoad = findViewById(R.id.tv_load);

        tvLoad.setText(loadStr);
    }

    public ProgressDialog setLoadContent(String str) {
        loadStr = str;
        if (Helper.isNotNull(tvLoad)) {
            tvLoad.setText(str);
        }
        return this;
    }
}
